package com.example.everying.constant;

import jakarta.validation.constraints.NotBlank;

/**
 * 交易类型常量定义
 */
public class OrderConstants {
    /**
     * 交易类型前缀
     */
    public static final String TRANSACTION_TYPE_PREFIX_DEPOSIT = "DE";
    public static final String TRANSACTION_TYPE_PREFIX_WITHDRAW = "WD";
    public static final String TRANSACTION_TYPE_PREFIX_ORDER = "OD";
    public static final String TRANSACTION_TYPE_PREFIX_TRANSFER = "TR";
    public static final String TRANSACTION_TYPE_PREFIX_POINTS = "PO";


    /**
     * 用户类型
     */
    public static final String USER_TYPE_PLATFORM = "0";
    public static final String USER_TYPE_USER = "1";

    /**
     * 充值交易类型
     */
    public static final String TRANSACTION_TYPE_DEPOSIT = "DEPOSIT";

    /**
     * 提现交易类型
     */
    public static final String TRANSACTION_TYPE_WITHDRAW = "WITHDRAW";


    /**
     * 订单交易类型 交易类型(0-用户充值 1-用户提现 2-用户支出 3-用户收入 4-平台支出 5-平台收入)
     */
    public static final String TYPE_USER_RECHARGE = "0";
    public static final String TYPE_USER_WITHDRAW = "1";
    public static final String TYPE_USER_EXPENSE = "2";
    public static final String TYPE_USER_INCOME = "3";
    public static final String TYPE_PLATFORM_EXPENSE = "4";
    public static final String TYPE_PLATFORM_INCOME = "5";

    /**
     * 订单类型  类型 0-用户预付款 1-用户收款 2-用户充值 3-用户提现 4-用户退款 5-用户取消申请退款 6-用户转账
     */
    public static final String ORDER_TYPE_PREPAY = "0";
    public static final String ORDER_TYPE_RECEIVE = "1";
    public static final String ORDER_TYPE_RECHARGE = "2";
    public static final String ORDER_TYPE_WITHDRAW = "3";
    public static final String ORDER_TYPE_REFUND = "4";
    public static final String ORDER_TYPE_CANCEL_REFUND = "5";
    public static final String ORDER_TYPE_TRANSFER = "6";


    /**
     * 订单类型
     */
    public static final String ORDER_TYPE_SINGLE = "1"; // 独立订单
    public static final String ORDER_TYPE_PARENT = "2"; // 父订单
    public static final String ORDER_TYPE_CHILD = "3";  // 子订单

    /**
     * 订单修改类型
     */
    public static final int UPDATE_TYPE_STATUS = 1; // 状态修改
    public static final int UPDATE_TYPE_AMOUNT = 2; // 金额修改
    public static final int UPDATE_TYPE_INFO = 3;   // 普通信息修改

    /**
     * 订单状态0-待接单 1-已接单 2-接单人已完成 3-发布人已完成 4-已完成 5-已取消 6-申诉中 7-已退款 8-已失效
     */
    public static final Integer ORDER_STATUS_WAIT = 0;      // 待接单
    public static final Integer ORDER_STATUS_ACCEPT = 1;   // 已接单
    public static final Integer ORDER_STATUS_WAIT_ACCEPT = 2; // 接单者待完成
    public static final Integer ORDER_STATUS_WAIT_COMPLETE = 3; // 发布人待完成
    public static final Integer ORDER_STATUS_COMPLETE = 4;   // 已完成
    public static final Integer ORDER_STATUS_CANCEL = 5;    // 已取消
    public static final Integer ORDER_STATUS_APPEAL = 6;   // 申诉中
    public static final Integer ORDER_STATUS_REFUND = 7;   // 已退款
    public static final Integer ORDER_STATUS_INVALID = 8;  // 已失效



    /**
     * 回调处理类型
     */
    public static final @NotBlank(message = "处理状态不能为空") String NOTIFY_STATUS_WAIT = "wait";
    public static final @NotBlank(message = "处理状态不能为空") String NOTIFY_STATUS_SUCCESS = "success";
    public static final @NotBlank(message = "处理状态不能为空") String NOTIFY_STATUS_FAIL = "fail";
    /**
     * 交易状态
     */
    public static final Integer TX_STATUS_SUCCESS = 0;
    public static final Integer TX_STATUS_FAIL = 1;

// 交易状态(CREATE:创建,PAYING:支付中,SUCCESS:成功,REFUND:转入退款,CLOSED:已关闭,REVOKED:已撤销)
    public static final String ORDER_STATUS_CREATE = "CREATE" ;
    public static final String ORDER_STATUS_PAYING = "PAYING" ;
    public static final String ORDER_STATUS_SUCCESS = "SUCCESS" ;
    public static final String ORDER_STATUS_REFUND_ = "REFUND" ;
    public static final String ORDER_STATUS_REVOKED = "REVOKED" ;
}

